package com.kaifamiao.month04.day07.work;

import java.util.Scanner;

public class Test06 {

    // 字符串倒置
    public static String reverse(String str) {
        StringBuilder newStr = new StringBuilder(str);
        return newStr.reverse().toString();
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入一串字符：");
        String str = in.next();
        System.out.println("您输入的字符" + str + "反转是：" + reverse(str));
    }
}
